package edu.jd.movieplatform.admin.a_movie.impl;

import edu.jd.movieplatform.admin.a_movie.a_MovieDto;
import edu.jd.movieplatform.admin.a_movie.a_MovieService;
import edu.jd.movieplatform.admin.a_movie.dao.a_MovieDao;
import edu.jd.movieplatform.common.Utils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.Map;

@Service
@Transactional
public class a_MovieServiceImpl implements a_MovieService {
    @Resource
    private a_MovieDao a_movieDao;


    @Override
    public Map<String, Object> geta_MovieList(a_MovieDto dto) {
        return Utils.getPage(dto,()->a_movieDao.finda_MovieList(dto));
    }

    @Override
    public void deleteMovie(Integer id) {
        a_movieDao.deleteMovie(id);
    }

    @Override
    public void addMovie(a_MovieDto dto) {
        a_movieDao.insertMovie(dto);
    }

    @Override
    public void updMovie(a_MovieDto dto) {
       a_movieDao.updateMovie(dto);
    }
}
